using System;

namespace Microsoft.PowerShell.CmdletManagement
{
    /// <summary>
    /// A class that represents a spec help example
    /// </summary>
    public class PsSpecHelpExample : IEquatable<PsSpecHelpExample>, ICloneable
    {
        public PsSpecHelpExample() { }

        public PsSpecHelpExample(int specHelpExampleId, string command,
            string output, string description, int cmdletid)
        {
            this.specHelpExampleId = specHelpExampleId;
            this.command = command;
            this.output = output;
            this.description = description;
            this.cmdletid = cmdletid;
        }

        public int Id
        {
            get { return specHelpExampleId; }
            set { specHelpExampleId = value; }
        }
        private int specHelpExampleId = -1;

        public int CmdletId
        {
            get { return cmdletid; }
            set { cmdletid = value; }
        }
        private int cmdletid = -1;

        public string Command
        {
            get { return command; }
            set { command = value; }
        }
        private string command;

        public string Output
        {
            get { return output; }
            set { output = value; }
        }
        private string output;

        public string Description
        {
            get { return description; }
            set { description = value; }
        }
        private string description;

        #region IEquatable<PsSpecHelpExample> Members

        public bool Equals(PsSpecHelpExample other)
        {
            if (other == null)
            {
                return false;
            }

            if (
                (this.Id == other.Id) &&
                (this.Command == other.Command) &&
                (this.Output == other.Output) &&
                (this.Description == other.Description) &&
                (this.CmdletId == other.CmdletId))
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        #endregion

        #region ICloneable Members

        public object Clone()
        {
            return this.MemberwiseClone();
        }

        #endregion
    }
}